package kr.hkit.powerjava.chapter22.project;

import java.util.HashSet;
import java.util.Random;
import java.util.Set;

public class Programming7 {
	public static void main(String[] args) {
		Set<Integer> lotto = new HashSet<Integer>();
		int ir = 0;
		Random rnd = new Random();
		
		while(lotto.size() < 6) {
			ir = rnd.nextInt(45) + 1;
			
			if(lotto.contains(ir)) {
				System.out.println("중복된 값 : " + ir);
			} else {
				lotto.add(ir);
			}
		}
		
		for(int a : lotto) {
			System.out.print(a + " ");
		}
		
		
		
	}
}